package cn.com.frame.core.job;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 定时去高德拉取数据
 */
@Component
public class GdMapJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        run(jobExecutionContext);
    }

    /**
     * 业务执行
     * @param jobExecutionContext
     */
    private void run(JobExecutionContext jobExecutionContext){
        JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();

        String strTime = new SimpleDateFormat("HH-mm-ss").format(new Date());

        System.err.println(jobExecutionContext.getJobDetail().getKey().getName()+"---"+strTime+"key =:" + jobDataMap.get("key"));

    }

}
